package middleware

import (
	"cloud-entropy-storage-system/server/internal/svc"
	"github.com/gin-gonic/gin"
	"net/http"
)

func CheckLoginPage(c *gin.Context) {
	if svc.IsSignedIn(c) {
		c.Redirect(http.StatusFound, "/")
	}
}

func IsLogin(c *gin.Context) {
	if !svc.IsSignedIn(c) {
		c.Redirect(http.StatusFound, "/login")
	}
}
